
/*
**************************************************************************************************************
File:         memory_stub.sv
Description:  Defines the DDR3 memory stub
Author     :  Rohit Kulkarni
**************************************************************************************************************
*/

`include "package.sv"

module DDR_memory(DDR_bus IF, input CK);

logic [DATA_WIDTH-1:0]  data_to_send  = DRAM_dummy_data;
int count_cycles = 0;
logic strobe_value = HIGH;

assign IF.DQ    = IF.DRAM_d_out ? data_to_send : 'z;
assign IF.DQS   = IF.DRAM_d_out ? strobe_value : 'z;
//assign IF.DQS   = 1;

  always_ff @(CK)
  begin
    if(IF.DRAM_d_out) 
    begin
      data_to_send  <=  data_to_send >> 1;
      strobe_value <= ~strobe_value;
      /*if(count_cycles == 0)
          strobe_value <= HIGH;
          //IF.assert_DQ_strobe();
      else
        //IF.toggle_DQ_strobe();
        strobe_value <= ~strobe_value;*/
    
    //count_cycles <= count_cycles + 1;
    end
/*    else begin
        data_to_send  <=  data_to_send;
        //count_cycles <= 0;
        strobe_value <= strobe_value;
      end
*/      
    
  end
  

  
endmodule






